<!doctype html>
<html lang="zh-cn">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>outline-offset实现加号</title>
</head>
<style>
  html,
  body {
    width: 100%;
    height: 100%;
    display: flex;
  }

  div {
    width: 200px;
    height: 200px;
    background-color: #fc3;
    box-sizing: border-box;
    margin: auto;
  }

  div {
    outline: 20px solid #000;
    outline-offset: 10px;
    animation: move 8s infinite linear;
  }

  @keyframes move {
    50% {
      outline-offset: -118px;
    }
    100% {
      outline-offset: -118px;
    }
  }
</style>
<body>
<div></div>
</body>
</html>
